#ifndef _UART_DRV_H_
#define _UART_DRV_H_
#include "hc32f460.h"

typedef enum
{
    UART_PORT_1 = 0,
    UART_PORT_2 = 1,
    UART_PORT_3 = 2,
    UART_PORT_4 = 3
} uart_port_t;

#define  UART_DRV_RECV_TIMEOUT   10

typedef void (*uart_recv_cb_t)(char *buffer, uint32_t size);

void uart_drv_init(uart_port_t port, uint32_t baud);
void uart_drv_deinit(uart_port_t port);
void uart_drv_rigister(uart_port_t port,
                       char *rxd_buffer,
                       uint32_t buf_size,
                       uart_recv_cb_t cb
                      );
void uart_drv_send(uart_port_t port, char *buffer, uint32_t size);
#endif

